# -*- coding: utf-8 -*-
from django.conf.urls.defaults import *
from django.contrib.auth.decorators import login_required
from trainings.views import exportexcel, TrainingsDetail, TrainingsList, TrainingsUpdateView, TrainingsCreateView

urlpatterns = patterns('',
    url(r'^report/(?P<arg>[-\w]+)/(?P<object_pk>[-\w]+)/$', exportexcel, name="training_report"),
    url(r'^list/(?P<arg>[-\w]+)/$', TrainingsList.as_view(), name="trainings_list"),
    url(r'^detail/(?P<arg>[-\w]+)/(?P<pk>[-\w]+)/$', TrainingsDetail.as_view(), name="trainings_detail"),
    url(r'^create/(?P<arg>[-\w]+)/$', login_required(TrainingsCreateView.as_view()), name="trainings_create"),
    url(r'^update/(?P<arg>[-\w]+)/(?P<pk>[-\w]+)/$', login_required(TrainingsUpdateView.as_view()), name="trainings_update"),
)